WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
motion_buffer.h
Go to the documentation of this file.
1// WOLF - Copyright (C) 2020-2026
2// Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
3// Authors: Joan Solà Ortega (jsola@iri.upc.edu) and
4// Joan Vallvé Navarro (jvallve@iri.upc.edu)
5// All rights reserved.
6//
7// This file is part of WOLF: http://www.iri.upc.edu/wolf
8// WOLF is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License version 3
10// as published by the Free Software Foundation.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19#pragma once
20
21#include "core/common/wolf.h"
23
24#include <list>
25#include <algorithm>
26
27namespace wolf
28{
29struct Motion
30{
31 public:
34 Eigen::VectorXd data_;
35 Eigen::MatrixXd data_cov_;
36 Eigen::VectorXd delta_;
37 Eigen::MatrixXd delta_cov_;
38 Eigen::VectorXd delta_integr_;
39 Eigen::MatrixXd delta_integr_cov_;
40 Eigen::MatrixXd jacobian_delta_;
41 Eigen::MatrixXd jacobian_delta_integr_;
42 Eigen::MatrixXd jacobian_calib_;
43 public:
44 Motion() = delete; // completely delete unpredictable stuff like this
45 Motion(const TimeStamp& _ts,
46 SizeEigen _data_size,
47 SizeEigen _delta_size,
48 SizeEigen _cov_size,
49 SizeEigen _calib_size);
50 Motion(const TimeStamp& _ts,
51 const Eigen::VectorXd& _data,
52 const Eigen::MatrixXd& _data_cov,
53 const Eigen::VectorXd& _delta,
54 const Eigen::MatrixXd& _delta_cov,
55 const Eigen::VectorXd& _delta_int,
56 const Eigen::MatrixXd& _delta_integr_cov,
57 const Eigen::MatrixXd& _jac_delta,
58 const Eigen::MatrixXd& _jac_delta_int,
59 const Eigen::MatrixXd& _jacobian_calib);
60 ~Motion();
61
62 private:
63 void resize(SizeEigen _data_s, SizeEigen _delta_s, SizeEigen _delta_cov_s, SizeEigen _calib_s);
64
65};
66
88class MotionBuffer : public std::list<Motion>
89{
90 public:
92 const Motion& getMotion(const TimeStamp& _ts) const;
93 void getMotion(const TimeStamp& _ts, Motion& _motion) const;
94 void split(const TimeStamp& _ts, MotionBuffer& _oldest_buffer);
95 void print(bool show_data = 0,
96 bool show_delta = 0,
97 bool show_delta_int = 0,
98 bool show_jacs = 0,
99 bool show_covs = 0);
100};
101
102} // namespace wolf
class for motion buffers.
Definition: motion_buffer.h:89
void split(const TimeStamp &_ts, MotionBuffer &_oldest_buffer)
Definition: motion_buffer.cpp:109
void print(bool show_data=0, bool show_delta=0, bool show_delta_int=0, bool show_jacs=0, bool show_covs=0)
Definition: motion_buffer.cpp:128
MotionBuffer()
Definition: motion_buffer.cpp:80
const Motion & getMotion(const TimeStamp &_ts) const
Definition: motion_buffer.cpp:85
TimeStamp implements basic functionalities for time stamps.
Definition: time_stamp.h:39
Definition: capture_base.h:23
EIGEN_DEFAULT_DENSE_INDEX_TYPE SizeEigen
Vector and Matrices size type for the Wolf project.
Definition: wolf.h:58
One instance of the buffered data, corresponding to a particular time stamp.
Definition: motion_buffer.h:30
Motion()=delete
SizeEigen cov_size_
Definition: motion_buffer.h:32
SizeEigen data_size_
Definition: motion_buffer.h:32
Eigen::VectorXd delta_integr_
the integrated motion or delta-integral
Definition: motion_buffer.h:38
Eigen::MatrixXd data_cov_
covariance of the instantaneous data
Definition: motion_buffer.h:35
Motion(const TimeStamp &_ts, const Eigen::VectorXd &_data, const Eigen::MatrixXd &_data_cov, const Eigen::VectorXd &_delta, const Eigen::MatrixXd &_delta_cov, const Eigen::VectorXd &_delta_int, const Eigen::MatrixXd &_delta_integr_cov, const Eigen::MatrixXd &_jac_delta, const Eigen::MatrixXd &_jac_delta_int, const Eigen::MatrixXd &_jacobian_calib)
Eigen::MatrixXd jacobian_delta_
Jacobian of the integration wrt delta_.
Definition: motion_buffer.h:40
~Motion()
Definition: motion_buffer.cpp:63
TimeStamp ts_
Time stamp.
Definition: motion_buffer.h:33
Eigen::MatrixXd jacobian_calib_
Jacobian of delta_integr wrt extra states (TBD by the derived processors)
Definition: motion_buffer.h:42
SizeEigen calib_size_
Definition: motion_buffer.h:32
Eigen::VectorXd data_
instantaneous motion data
Definition: motion_buffer.h:34
Eigen::MatrixXd delta_integr_cov_
covariance of the integrated delta
Definition: motion_buffer.h:39
Eigen::VectorXd delta_
instantaneous motion delta
Definition: motion_buffer.h:36
SizeEigen delta_size_
Definition: motion_buffer.h:32
Eigen::MatrixXd delta_cov_
covariance of the instantaneous delta
Definition: motion_buffer.h:37
Eigen::MatrixXd jacobian_delta_integr_
Jacobian of the integration wrt delta_integr_.
Definition: motion_buffer.h:41